<li>
  <p>
    {% if change.method == "add_one_value" %}

      {{ _('Added field <q>{key}</q> with value <q>{value}</q> to resource {resource_link} in {pkg_link}').format(
          pkg_link = '<a href="{pkg_url}">{pkg_name}</a>'.format(
            pkg_url = h.url_for(controller='dataset',
                                action='read', id=change.pkg_id),
            pkg_name = change.title
          )|safe,
          resource_link = '<a href="{resource_url}">{resource_name}</a>'.format(
            resource_url = h.url_for(qualified=True, controller='resource',
                                      action='read', id=change.pkg_id,
                                      resource_id = change.resource_id),
            resource_name = change.resource_name
          )|safe,
          key = change.key,
          value = change.value
        ) }}

    {% elif change.method == "add_one_no_value" %}

      {{ _('Added field <q>{key}</q> to resource {resource_link} in {pkg_link}').format(
          pkg_link = '<a href="{pkg_url}">{pkg_name}</a>'.format(
            pkg_url = h.url_for(controller='dataset',
                                action='read', id=change.pkg_id),
            pkg_name = change.title
          )|safe,
          resource_link = '<a href="{resource_url}">{resource_name}</a>'.format(
            resource_url = h.url_for(qualified=True, controller='resource',
                                      action='read', id=change.pkg_id,
                                      resource_id = change.resource_id),
            resource_name = change.resource_name
          )|safe,
          key = change.key,
      ) }}

    {% elif change.method == "add_multiple" %}

      {{ _('Added the following fields to resource {resource_link} in {pkg_link}').format(
          pkg_link = '<a href="{pkg_url}">{pkg_name}</a>'.format(
            pkg_url = h.url_for(controller='dataset',
                                action='read', id=change.pkg_id),
            pkg_name = change.title
          )|safe,
          resource_link = '<a href="{resource_url}">{resource_name}</a>'.format(
            resource_url = h.url_for(qualified=True, controller='resource',
                                      action='read', id=change.pkg_id,
                                      resource_id = change.resource_id),
            resource_name = change.resource_name
          )|safe
        ) }}
      <ul>
        {% for item in change.key_list %}
          {% if change.value_list[item] != "" %}
            {{ _('{key} with value {value}').format(
              key = item,
              value = change.value_list[item]
            )|safe }}
          {% else %}
            {{ _('{key}').format(
              key = item
            )|safe }}
          {% endif %}
        {% endfor %}
      </ul>

    {% elif change.method == "remove_one" %}

      {{ _('Removed field <q>{key}</q> from resource {resource_link} in {pkg_link}').format(
          pkg_link = '<a href="{pkg_url}">{pkg_name}</a>'.format(
            pkg_url = h.url_for(controller='dataset',
                                action='read', id=change.pkg_id),
            pkg_name = change.title
          )|safe,
          resource_link = '<a href="{resource_url}">{resource_name}</a>'.format(
            resource_url = h.url_for(qualified=True, controller='resource',
                                      action='read', id=change.pkg_id,
                                      resource_id = change.resource_id),
            resource_name = change.resource_name
          )|safe,
          key = change.key
      ) }}

    {% elif change.method == "remove_multiple" %}

      {{ _('Removed the following fields from resource {resource_link} in {pkg_link}').format(
          pkg_link = '<a href="{pkg_url}">{pkg_name}</a>'.format(
            pkg_url = h.url_for(controller='dataset',
                                action='read', id=change.pkg_id),
            pkg_name = change.title
          )|safe,
          resource_link = '<a href="{resource_url}">{resource_name}</a>'.format(
            resource_url = h.url_for(qualified=True, controller='resource',
                                      action='read', id=change.pkg_id,
                                      resource_id = change.resource_id),
            resource_name = change.resource_name
          )|safe
        ) }}
      <ul>
        {% for item in change.key_list %}
          {{ _('{key}').format(
            key = item
          )|safe }}
        {% endfor %}
      </ul>

    {% elif change.method == "change_value_with_old" %}

      {{ _('Changed value of field <q>{key}</q> of resource {resource_link} to <q>{new_val}</q> (previously <q>{old_val}</q>) in {pkg_link}').format(
          pkg_link = '<a href="{pkg_url}">{pkg_name}</a>'.format(
            pkg_url = h.url_for(controller='dataset',
                                action='read', id=change.pkg_id),
            pkg_name = change.title
          )|safe,
          resource_link = '<a href="{resource_url}">{resource_name}</a>'.format(
            resource_url = h.url_for(qualified=True, controller='resource',
                                      action='read', id=change.pkg_id,
                                      resource_id = change.resource_id),
            resource_name = change.resource_name
          )|safe,
          key = change.key,
          new_val = change.new_value,
          old_val = change.old_value
        ) }}

    {% elif change.method == "change_value_no_old" %}

      {{ _('Changed value of field <q>{key}</q> to <q>{new_val}</q> in resource {resource_link} in {pkg_link}').format(
          pkg_link = '<a href="{pkg_url}">{pkg_name}</a>'.format(
            pkg_url = h.url_for(controller='dataset',
                                action='read', id=change.pkg_id),
            pkg_name = change.title
          )|safe,
          resource_link = '<a href="{resource_url}">{resource_name}</a>'.format(
            resource_url = h.url_for(qualified=True, controller='resource',
                                      action='read', id=change.pkg_id,
                                      resource_id = change.resource_id),
            resource_name = change.resource_name
          )|safe,
          key = change.key,
          new_val = change.new_value
        ) }}

    {% elif change.method == "change_value_no_new" %}

      {{ _('Removed the value of field <q>{key}</q> in resource {resource_link} in {pkg_link}').format(
          pkg_link = '<a href="{pkg_url}">{pkg_name}</a>'.format(
            pkg_url = h.url_for(controller='dataset',
                                action='read', id=change.pkg_id),
            pkg_name = change.title
          )|safe,
          resource_link = '<a href="{resource_url}">{resource_name}</a>'.format(
            resource_url = h.url_for(qualified=True, controller='resource',
                                      action='read', id=change.pkg_id,
                                      resource_id = change.resource_id),
            resource_name = change.resource_name
          )|safe,
          key = change.key,
          new_val = change.new_value
        ) }}
    {% else %}

      {{ _('No fields were updated. See the metadata diff for more details.') }}

    {% endif %}
  </p>
</li>
